
#pragma once

#include <string>
#include "fiber.h"

namespace dulymoo {

class FiberEnv;

class FiberContext
{
    friend class FiberEnv;

private:
    FiberContext(void (*func)(void*), void* arg, unsigned long stack_size=0, const char* name=NULL);
    FiberContext(const FiberContext&);  // unimplemented
    FiberContext& operator= (const FiberContext&);  // unimplemented

public:
    void SetState(const char* state);

private:
    static unsigned long next_id_;
    const unsigned long id_;
    const std::string name_;
    Fiber fiber_;
    const char* state_;
};

}  // namespace dulymoo

